﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HP.Cachalote.DataModels;
using HP.Cachalote.Services.Shared;

namespace HP.Cachalote.UnitTests.FakeRepositories
{
    public class FakeDataSource
    {
        public static List<TodoLabel> TodoLabels = new List<TodoLabel>();
        public static List<TodoItem> TodoItems = new List<TodoItem>();

        /// <summary>
        /// |
        /// |--| label01  （item1 & item2）
        /// |       |-- label0101  （item3）
        /// |               |-- label010101          
        /// |       |-- label0102
        /// |
        /// |--| label02  
        /// |
        /// </summary>
        static FakeDataSource()
        {
            TodoLabel label11 = new TodoLabel
            {
                ID = 1,
                Name = "Label 01",
                Parent = null,
                Icon = string.Empty,
                TodoItems = null,
                OrderIndex = 0
            };

            TodoLabel label12 = new TodoLabel
            {
                ID = 2,
                Name = "Label 02",
                Parent = null,
                Icon = string.Empty,
                TodoItems = null,
                OrderIndex = 1
            };

            TodoLabel label21 = new TodoLabel
            {
                ID = 3,
                Name = "Label 01_01",
                Parent = label11,
                Icon = string.Empty,
                TodoItems = null,
                OrderIndex = 2
            };

            TodoLabel label22 = new TodoLabel
            {
                ID = 4,
                Name = "Label 01-02",
                Parent = label11,
                Icon = string.Empty,
                TodoItems = null,
                OrderIndex = 0
            };

            TodoLabel label31 = new TodoLabel
            {
                ID = 5,
                Name = "Label 01-01-01",
                Parent = label21,
                Icon = string.Empty,
                TodoItems = null,
                OrderIndex = 0
            };

            TodoLabels.Add(label11);
            TodoLabels.Add(label12);
            TodoLabels.Add(label21);
            TodoLabels.Add(label22);
            TodoLabels.Add(label31);

            TodoItem item1 = new TodoItem
            {
                ID = 1,
                CreateOn = DateTime.Now,
                UpdateOn = DateTime.Now,
                ReminderTime = DateTime.Now.AddHours(3),
                DueDate = DateTime.Now.AddHours(3),
                StartTime = DateTime.Now.AddHours(3),
                EndTime = DateTime.Now.AddHours(4),
                IsDismissed = false,
                IsDone = false,
                Label = label11,
                NeedReminder = true,
                Note = "Note string 1",
                Priority = 1,
                Title = "todo item 01",
            };

            TodoItem item2 = new TodoItem
            {
                ID = 2,
                CreateOn = DateTime.Now,
                UpdateOn = DateTime.Now,
                ReminderTime = DateTime.Now.AddHours(3),
                DueDate = DateTime.Now.AddHours(3),
                StartTime = DateTime.Now.AddHours(3),
                EndTime = DateTime.Now.AddHours(4),
                IsDismissed = false,
                IsDone = false,
                Label = label11,
                NeedReminder = true,
                Note = "Note string 2",
                Priority = 1,
                Title = "todo item 02"
            };

            label11.TodoItems = new List<TodoItem> { item1, item2 };

            TodoItem item3 = new TodoItem
            {
                ID = 3,
                CreateOn = DateTime.Now,
                UpdateOn = DateTime.Now,
                ReminderTime = DateTime.Now.AddHours(3),
                DueDate = DateTime.Now.AddHours(3),
                StartTime = DateTime.Now.AddHours(3),
                EndTime = DateTime.Now.AddHours(4),
                IsDismissed = false,
                IsDone = false,
                Label = label21,
                NeedReminder = true,
                Note = "Note string 3",
                Priority = 1,
                Title = "todo item 03"
            };

            label21.TodoItems = new List<TodoItem> { item3 };
            TodoItems.Add(item1);
            TodoItems.Add(item2);
            TodoItems.Add(item3);
        }
    }
}
